<%--
  Created by IntelliJ IDEA.
  User: xuweijie
  Date: 17-5-17
  Time: 下午7:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Register</title>
    <!-- JqueryUI -->
    <link rel="stylesheet" type="text/css" href="${style}/front/jquery-ui.css">
    <link rel="stylesheet" href="${Layui}/css/layui.css" media="all">

    <link rel="stylesheet" type="text/css" href="${style}/animate.min.css">
    <link rel="stylesheet" type="text/css" href="${style}/input.css">
    <!-- Bootstrap -->
    <link rel="stylesheet" type="text/css" href="${style}/front/bootstrap.min.css">
    <!-- Awesome font icons -->
    <link rel="stylesheet" type="text/css" href="${style}/front/font-awesome.min.css" media="screen">
    <!-- Owlcoursel -->
    <link rel="stylesheet" type="text/css" href="${style}/front/owl-coursel/owl.carousel.css">
    <link rel="stylesheet" type="text/css" href="${style}/front/owl-coursel/owl.transitions.css">
    <!-- Magnific-popup -->
    <link rel="stylesheet" type="text/css" href="${style}/front/magnific-popup/magnific-popup.css">
    <!-- Style -->
    <link rel="stylesheet" type="text/css" href="${style}/front/style.css" media="screen">
    <!-- Fw -->
    <link rel="stylesheet" type="text/css" href="${style}/front/fw.css" media="screen">

    <link rel="stylesheet" type="text/css" href="${style}/input.css">
</head>
<body>
<%--herder--%>
<jsp:include page="../header.jsp"/>

<section class="m-t-0">
    <div class="container m-t-30">
        <h3 class="title f-30">个人中心</h3>
        <%--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>--%>
        <div class="row ht-tabs ht-tabs-product">
            <div class="col-md-3 col-lg-2 pull-left-xs">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li class="panel panel-default active">
                        <a href="/front/mybuycar/buycarlist">购物车</a>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse1">我的订单</a>
                        <div id="collapse1" class="panel-collapse collapse in">
                            <ul class="panel-body">
                                <li>
                                    <a href="/front/purchase/alls">全部</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/waits">待付款</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/payed">待发货</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/sent">待收货</a>
                                </li>
                                <li>
                                    <a href="/front/purchase/done">已完成</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse2">优惠券</a>
                        <div id="collapse2" class="panel-collapse collapse in">
                            <ul class="panel-body">
                                <li role="presentation">
                                    <a href="/front/mycoupons/showdetail">全部优惠券</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/mycoupons/showdetailbyMycoupons">我的优惠券</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="panel panel-default">
                        <a href="/front/wallet">我的钱包</a>
                    </li>
                    <li class="panel panel-default">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapse4">个人信息管理</a>
                        <div id="collapse4" class="panel-collapse collapse in">
                            <ul class="panel-body" >
                                <li role="presentation">
                                    <a href="/front/persion/showMyInfo">我的信息</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/address/showaddress">地址管理</a>
                                </li>
                                <li role="presentation">
                                    <a href="/front/persion/showupdatepwd">修改密码</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="col-md-9 col-lg-10">
                <!-- 主要显示区域-->
                <div class="content" style="margin-bottom: 250px;">
                    <input type="text" value="${pageIndex}" hidden id="pageIndex">
                    <input type="text" value="${pageCount}" hidden id="pageCount">
                    <c:if test="${croPurchase!=null}">
                    <fieldset class="layui-elem-field layui-field-title" style="width: 50%;">
                        <legend>我的购物车</legend>
                    </fieldset>
                    <table class="layui-table" lay-even="" lay-skin="row">
                        <colgroup>
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                            <col width="50">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>名称</th>
                            <th>描述</th>
                            <th>图片</th>
                            <th>原价</th>
                            <th>成交价</th>
                            <th>数量</th>
                            <th>总价</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <c:set var="i" value="${0}" />
                        <c:forEach items="${goodsdetails}" var="goods">
                            <tr>
                                <c:set var="i" value="${i+1}" />
                                <td>${i}</td>
                                <td>${goods.name}</td>
                                <td>${goods.describ}</td>
                                <td><img src="${goods.photo}" width="32px" height="32px"></td>
                                <td>${goods.price}</td>
                                <td>${goods.actprice}</td>
                                <td>${goods.numbers}</td>
                                <td>${goods.sumprice}</td>
                                <td>
                                    <div class="layui-btn-group">
                                        <a data-method="update" buycarid="${goods.id}" class="layui-btn layui-btn-small layui-btn-normal updatebuycar">
                                            <i class="layui-icon">&#xe642;</i>
                                        </a>
                                        <a data-method="delete" buycarid="${goods.id}" class="layui-btn layui-btn-small layui-btn-danger delbuycar">
                                            <i class="layui-icon">&#xe640;</i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <div id="buycarpage"></div>
                        <div style="float: right;margin-top: 30px;">
                            <font style="font-size: large;margin-right: 30px;">总和：${numprice}</font>
                            <button type="button" numprice="${numprice}" purchaseid="${croPurchase.id}"  class="btn btn-lg btn-danger jiesuan">结 算</button>
                        </div>
                    </c:if>
                    <c:if test="${croPurchase==null}">
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend>当前购物车内暂无商品</legend>
                        </fieldset>
                    </c:if>

                    <%--更新弹出框样式--%>
                    <form id="updatebuycar" class="layui-form" hidden>
                        <br>
                        <div class="layui-form-item">
                            <label class="layui-form-label">名称</label>
                            <div class="layui-input-block">
                                <input disabled type="text" id="goodname" name="goodname" autocomplete="off" class="layui-input" style="width: 95%">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">数量</label>
                            <div class="layui-input-block">
                                <input type="text" id="numbers" name="numbers" required  lay-verify="required" placeholder="请输入数量" autocomplete="off" class="layui-input" style="width: 95%">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<%--footer--%>
<jsp:include page="../footer.jsp"/>

<!-- jQuery -->
<script src="${jquery}/jquery.js" charset="utf-8"></script>
<!-- JqueryUI -->
<script src="${jquery}/jquery-ui.js"></script>
<!-- Bootstrap -->
<script src="${Bootstrap}/js/bootstrap.js"></script>
<!-- Owl-coursel -->
<script src="${Js}/front/owl-coursel/owl.carousel.js"></script>
<!-- Magnific-popup -->
<script src="${Js}/front/magnific-popup/jquery.magnific-popup.min.js"></script>
<!-- Script -->
<script src="${Js}/front/script.js"></script>
<script src="${Layui}/layui.js" charset="utf-8"></script>
<script src="${Js}/front/mybuycar/mybuycar.js" charset="utf-8"></script>

</body>
</html>

